package cn.i7baozh.starter.common.controller;


import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
import org.springframework.web.servlet.mvc.method.annotation.ServletResponseMethodArgumentResolver;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * app端注解，返回统一封装json
 * 注意这个注解在使用时如果返回值为void则参数中禁止有HttpServletResponse。不然mvc会将其视为不需要自定义的返回，而直接返回空
 * @see ServletResponseMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter,
 *  org.springframework.web.method.support.ModelAndViewContainer,
 *  org.springframework.web.context.request.NativeWebRequest,
 *  org.springframework.web.bind.support.WebDataBinderFactory)
 *
 * @see HandlerMethodArgumentResolverComposite#resolveArgument(org.springframework.core.MethodParameter,
 *  org.springframework.web.method.support.ModelAndViewContainer,
 *  org.springframework.web.context.request.NativeWebRequest,
 *  org.springframework.web.bind.support.WebDataBinderFactory)
 * @author: baoqi.zhang
 * @date: 2020/6/1 20:16
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface GatewayRestClientApi {
}
